//
//  UIViewController+LYExtension.h
//  LYRouter
//
//  Created by cqck on 2021/11/4.
//

#import <UIKit/UIKit.h>

@protocol LYNavigationBackHandlerProtocol <NSObject>

@optional
// 重写下面的方法以拦截导航栏返回按钮点击事件，返回 YES 则 pop，NO 则不 pop
- (BOOL)navigationShouldPopOnBackButton;

// 重写下面的方法以独自处理导航栏，返回 YES 则 独自处理，NO 则不 统一处理
- (BOOL)ownProcessNavigation;

@end

@interface UIViewController (LYExtension) <LYNavigationBackHandlerProtocol>

/**
 @brief 获取当前显示的controller
 
 @return UIViewController
 */
+ (UIViewController *)topViewController;

@end
